<extend name="Public/base"/>

<block name="body">
    <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <div class="main-title">
        <h2>
            <if condition="ACTION_NAME eq 'add'">
                新增游戏
            <else/>
                编辑游戏
            </if>
            
            <button class="btn btn-default btn-return" onclick="javascript:history.back(-1);return false;"><i class="glyphicon glyphicon-share-alt"></i> 返 回</button>
        </h2>
    </div>
    <form action="" method="post" class="form">
        <div class="form-item form-group">
            <label class="item-label">标题<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text form-control input-large" name="name" value="{$name}">
            </div>
        </div>
        <div class="form-item form-group">
            <label class="item-label">客户端类型<span class="check-tips"></span></label>
            <volist name=":C('client_type')" id="ct">
            <label class="checkbox-inline">
            <input type="checkbox" name="client_type[]" <if condition="in_array($key, $client_type)">checked</if> value="{$key}"  />{$ct}
            </label>
            </volist>
        </div>
        <div class="form-item form-group">
            <label class="item-label">排序<span class="check-tips">（用于显示的顺序）</span></label>
            <div class="controls">
                <input type="text" class="text form-control input-mini" name="sort" value="{$sort|default=1}">
            </div>
        </div>
        <div class="form-item form-group cf">
            <label class="item-label">LOGO<span class="check-tips">(请按照宽高为140x140 png)</span></label>
            <div class="controls">
                <div class="controls">
                    <input type="file" id="upload_picture_logo">
                    <input type="hidden" name="logo" id="cover_id_logo" value="{$logo}" />
                    <div class="upload-img-box">
                        <notempty name="logo">
                        <div class="upload-pre-item"><img src="{:url_format($logo)}"/></div>
                        </notempty>
                    </div>
                </div>
                {:hook('adminPicUpload', array('id'=>"upload_picture_logo",'return'=>"cover_id_logo", 'type' => 'path'))}                                                              
            </div>
        </div>
        <div class="form-item form-group cf">
            <label class="item-label">图片<span class="check-tips">(请按照最长边不低于400px png)</span></label>
            <div class="controls">
                <div class="controls">
                    <input type="file" id="upload_picture_pic">
                    <input type="hidden" name="pic" id="cover_id_pic" value="{$pic}" />
                    <div class="upload-img-box">
                        <notempty name="pic">
                        <div class="upload-pre-item"><img src="{:url_format($pic)}"/></div>
                        </notempty>
                    </div>
                </div>
                {:hook('adminPicUpload', array('id'=>"upload_picture_pic",'return'=>"cover_id_pic", 'type' => 'path'))}                                                              
            </div>
        </div>
        <div class="form-item form-group cf">
            <label class="item-label">封面<span class="check-tips">(183*249 jpg)</span></label>
            <div class="controls">
                <div class="controls">
                    <input type="file" id="upload_picture_cover">
                    <input type="hidden" name="cover" id="cover_id_cover" value="{$cover}" />
                    <div class="upload-img-box">
                        <notempty name="cover">
                        <div class="upload-pre-item"><img src="{:url_format($cover)}"/></div>
                        </notempty>
                    </div>
                </div>
                {:hook('adminPicUpload', array('id'=>"upload_picture_cover",'return'=>"cover_id_cover", 'type' => 'path'))}                                                              
            </div>
        </div>
        <div class="form-item form-group cf">
            <label class="item-label">背景图<span class="check-tips">(1280*720 jpg)</span></label>
            <div class="controls">
                <div class="controls">
                    <input type="file" id="upload_picture_back">
                    <input type="hidden" name="background" id="cover_id_back" value="{$background}" />
                    <div class="upload-img-box">
                        <notempty name="background">
                        <div class="upload-pre-item"><img src="{:url_format($background)}"/></div>
                        </notempty>
                    </div>
                </div>
                {:hook('adminPicUpload', array('id'=>"upload_picture_back",'return'=>"cover_id_back", 'type' => 'path'))}                                                              
            </div>
        </div>

        <div class="form-item form-group cf">
            <label class="item-label">网站探索页图标<span class="check-tips">(160*110 jpg)</span></label>
            <div class="controls">
                <div class="controls">
                    <input type="file" id="upload_picture_pc_explore">
                    <input type="hidden" name="pc_explore" id="cover_id_pc_explore" value="{$pc_explore}" />
                    <div class="upload-img-box">
                        <notempty name="pc_explore">
                        <div class="upload-pre-item"><img src="{:url_format($pc_explore)}"/></div>
                        </notempty>
                    </div>
                </div>
                {:hook('adminPicUpload', array('id'=>"upload_picture_pc_explore",'return'=>"cover_id_pc_explore", 'type' => 'path'))}                                                              
            </div>
        </div>
        <div class="form-item form-group cf">
            <label class="item-label">网站专区页背景图<span class="check-tips">(1920*980 jpg)</span></label>
            <div class="controls">
                <div class="controls">
                    <input type="file" id="upload_picture_pc_back">
                    <input type="hidden" name="pc_background" id="cover_id_pc_back" value="{$pc_background}" />
                    <div class="upload-img-box">
                        <notempty name="pc_background">
                        <div class="upload-pre-item"><img src="{:url_format($pc_background)}"/></div>
                        </notempty>
                    </div>
                </div>
                {:hook('adminPicUpload', array('id'=>"upload_picture_pc_back",'return'=>"cover_id_pc_back", 'type' => 'path'))}                                                              
            </div>
        </div>
        <div class="form-item form-group">
            <label class="item-label">游戏代码<span class="check-tips">英文code</span></label>
            <div class="controls">
                <input type="text" class="text form-control input-mini" name="code" value="{$code}">
            </div>
        </div>

        <div class="form-item form-group">
            <label class="item-label">描述<span class="check-tips"></span></label>
            <div class="controls">
                <label class="input-large">
                    <textarea rows="4" class="form-control" name="detail">{$detail}</textarea>
                </label>
            </div>
        </div>
        <div class="form-item form-group">
            <label class="item-label">状态<span class="check-tips"></span></label>
            <label class="radio-inline">
            <input type="radio" name="status" <if condition="$status eq 1 or $status eq ''">checked</if> value="1"  /> 开启
            </label>
            <label class="radio-inline">
            <input type="radio" name="status" <eq name="status" value="0">checked</eq> value="0"  />关闭
            </label>
        </div>
        <div class="form-item form-group form-action">
            <input type="hidden" name="id" value="{$id}" />
            <button class="btn submit-btn ajax-post btn-success btn-block" id="submit" type="submit" target-form="form">确 定</button>
            <!-- <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button> -->
        </div>
    </form>
</block>

<block name="script">
    <script type="text/javascript">
        //导航高亮
        highlight_subnav('{:U('Game/index')}');
    </script>
</block>
